﻿

#region Using Statements

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Threading;
using System.ComponentModel;
using System.Reflection;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Design;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using Freeform;
using FGame = Freeform.Game;
using XGame = Microsoft.Xna.Framework.Game;
using FComponent = Freeform.Component;
using FViewport = Freeform.Viewport;

#endregion


namespace Freeform
{
    /// <summary>
    /// Entities are renderable components that make up a scene in a world.
    /// </summary>
    public class Entity : Component
    {

        #region Members

        /// <summary>
        /// Gets the world that this entity renders to.
        /// </summary>
        public World World { get; private set; }


        /// <summary>
        /// Gets whether or not the Entity should be rendered.
        /// </summary>
        public Boolean IsVisible { get; set; }

        #endregion


        #region Init

        /// <summary>
        /// Creates a new entity and automatically links it to the given world.
        /// </summary>
        /// <param name="World">The world that this entity belongs to.</param>
        public Entity(World World) 
            : base(World.ComponentList)
        {
            this.World = World;
            IsEnabled = true;
            IsLoaded = true;
            IsVisible = true;
        }

        #endregion


        #region Update


        #endregion


        #region Draw

        /// <summary>
        /// Allows the entity to draw itself.
        /// </summary>
        /// <param name="Time">Provides a snapshot of timing values.</param>
        /// <param name="Batch">The spritebatch to render to.</param>
        public virtual void Draw(GameTime Time, FViewport Viewport)
        {

        }

        #endregion


        #region Dispose

        /// <summary>
        /// Disposes the entity and removes it from the world.
        /// </summary>
        protected override void OnDispose()
        {
            base.OnDispose();
        }

        #endregion


        #region Utility


        #endregion

    }
}